﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="build/accordionview/accordionview/utilities.js" type="text/javascript"></script>
    <link href="build/assets/skins/sam/accordionview.css" rel="stylesheet" type="text/css" />
    <link href="build/assets/skins/sam/reset-fonts.css" rel="stylesheet" type="text/css" />
    



    <link rel="stylesheet" type="text/css" href="build/fonts/fonts-min.css" />
    <link rel="stylesheet" type="text/css" href="build/treeview/assets/skins/sam/treeview.css" />
    <script type="text/javascript" src="build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="build/treeview/treeview-min.js"></script>
    <link rel="stylesheet" type="text/css" href="build/treeview/assets/css/folders/tree.css">
</head>
<body class="yui-skin-sam">
    <div id="wrapper">
        <ul id="mymenu">
            <li>
                <h3>Name</h3>
                <div>
                    <div id="treeDiv1"></div>                 
                    <script type="text/javascript">
                        (function () {
                            var tree;
                            function treeInit() {
                                buildRandomTextNodeTree();
                                YAHOO.util.Event.on("expand", "click", function (e) {
                                    YAHOO.log("展开所有树形节点", "info", "example");
                                    tree.expandAll();
                                    YAHOO.util.Event.preventDefault(e);
                                });
                                YAHOO.util.Event.on("collapse", "click", function (e) {
                                    YAHOO.log("收缩所有树形节点", "info", "example");
                                    tree.collapseAll();
                                    YAHOO.util.Event.preventDefault(e);
                                });
                            }
                            function buildRandomTextNodeTree() {
                                tree = new YAHOO.widget.TreeView("treeDiv1");
                                for (var i = 0; i < Math.floor((Math.random() * 4) + 3); i++) {
                                    var tmpNode = new YAHOO.widget.TextNode("label-" + i, tree.getRoot(), false);
                                    buildRandomTextBranch(tmpNode);
                                }
                                tree.draw();
                            }
                            function buildRandomTextBranch(node) {
                                if (node.depth < 6) {
                                    for (var i = 0; i < Math.floor(Math.random() * 4); i++) {
                                        var tmpNode = new YAHOO.widget.TextNode(node.label + "-" + i, node, false);
                                        buildRandomTextBranch(tmpNode);
                                    }
                                }
                            }
                            YAHOO.util.Event.onDOMReady(treeInit);

                        })();
 
                    </script>
                </div>
            </li>
            <li>
                <h3>
                    Address</h3>
                <div>
                    <div id="treeDiv2"></div>
                    <script type="text/javascript">
                        (function () {
                            var tree;
                            function treeInit() {
                                buildRandomTextNodeTree();
                                YAHOO.util.Event.on("expand", "click", function (e) {
                                    YAHOO.log("展开所有树形节点", "info", "example");
                                    tree.expandAll();
                                    YAHOO.util.Event.preventDefault(e);
                                });
                                YAHOO.util.Event.on("collapse", "click", function (e) {
                                    YAHOO.log("收缩所有树形节点", "info", "example");
                                    tree.collapseAll();
                                    YAHOO.util.Event.preventDefault(e);
                                });
                            }
                            function buildRandomTextNodeTree() {
                                tree = new YAHOO.widget.TreeView("treeDiv2");
                                for (var i = 0; i < Math.floor((Math.random() * 4) + 3); i++) {
                                    var tmpNode = new YAHOO.widget.TextNode("label-" + i, tree.getRoot(), false);
                                    buildRandomTextBranch(tmpNode);
                                }
                                tree.draw();
                            }
                            function buildRandomTextBranch(node) {
                                if (node.depth < 6) {
                                    for (var i = 0; i < Math.floor(Math.random() * 4); i++) {
                                        var tmpNode = new YAHOO.widget.TextNode(node.label + "-" + i, node, false);
                                        buildRandomTextBranch(tmpNode);
                                    }
                                }
                            }
                            YAHOO.util.Event.onDOMReady(treeInit);

                        })();
 
                    </script>
                </div>
            </li>
            <li>
                <h3>
                    Age / Sex</h3>
                <div>
                    
                </div>
            </li>
        </ul>
    </div>
    <script src="build/accordionview/accordionview/accordionview.js" type="text/javascript"></script>
    <script type="text/javascript">
        var menu1 = new YAHOO.widget.AccordionView('mymenu', {
            collapsible: true,
            width: '100%',
            expandItem: 0,
            animationSpeed: '0.1',
            animate: false,
            autofillheight:'body'
        });
	</script>
    
</body>
</html>
